<div class="page">
	<div class="pageContent">
		<div class="panelBar">
			<ul class="toolBar">
				<li>
					<a class="add" href="page/page/page_add.html" target="dialog"
						width="750" height="540"><span>添加</span> </a>
				</li>
				<li>
					<a class="delete" url="/page/{page_id}" area="tbody.list"
						callback="reload" type="delete" target="navTabTodo"
						title="确定要删除选中的数据吗？" warn="请选择需要删除的数据项！"><span>删除</span> </a>
				</li>
				<li>
					<a class="add" url="/page/{page_id}/html" callback="createPageHtml" type="post" target="navTabTodo"
					warn="请选择需要生成HTML页面的数据项！"><span>生成HTML页面</span> </a>
				</li>
			</ul>
		</div>

		<table class="list" width="98%" layoutH="54">
			<thead>
				<tr>
					<th width="3%">
						<input type="checkbox" name="objectId" value="page_id" />
					</th>
					<th width="3%">
						
					</th>
					<th width="3%">
						id
					</th>
					<th width="15%">
						标题
					</th>
					<th width="12%">
						唯一键
					</th>
					<th width="18%">
						关键字
					</th>
					<th>
						页面描述
					</th>
					<th align="right" width="15%">
						操作
					</th>
				</tr>
			</thead>
			<tbody style="display: none;" class="templet">
				<tr page="${page_id}" put="/page/${page_id}">
					<td>
						<input type="checkbox" name="page_id" value="${page_id}" />
					</td>
					<td><div><a class="collapsable" target="load"
							url="page/page/layout/layout_list.html?page_id=${page_id}"
							rel="page${page_id}_layout"></a></div>
					</td>
					<td>
						${page_id}
					</td>
					<td name="title" title="${title}" class="edit">
						${title}
					</td>
					<td name="pagekey" title="${pagekey}" class="edit">
						${pagekey}
					</td>
					<td name="keywords" title="${keywords}" class="edit" type="textarea">
						${keywords}
					</td>
					<td name="description" title="${description}" class="edit" type="textarea">
						${description}
					</td>
					<td>
						<a class="edit"
							href="page/page/page_update.html?page_id=${page_id}"
							target="dialog" warn="非法参数（${page_id}）" width="750" height="600"
							callback="updatePage" title="修改页面【${title}】"><span>修改</span>
						</a>
						<a class="edit" target="navTab"
							href="page/layout/layout_list.html?page_id=${page_id}"
							rel="page${page_id}" title="${title}"><span>详细</span> </a>
						<a class="edit" warn="非法参数（${page_id}）" target="navTabTodo"
							type="put" url="page/${page_id}/index" callback="setHomePage" isHomePage="${is_index}"><span>置为首页</span>
						</a>
					</td>
				</tr>
				<tr class="hide">
					<td colspan="8" align="right" id="page${page_id}_layout" class="shade" style="padding-bottom: 3px;">

					</td>
				</tr>
			</tbody>
			<tbody class="list" action="/page">

			</tbody>
		</table>

		<div class="panelBar">
			<div class="pages"></div>
			<div class="pagination" totalCount="0" numPerPage="20" pageNumShown="10" currentPage="1"></div>
		</div>

	</div>
</div>
<script>
function updatePage(item){
	var table=$("table.list");
	var page=$("tr[page="+item.page_id+"]",table);
	page.find("td[name=title]").text(item.title);
	page.find("td[name=pagekey]").text(item.pagekey);
	page.find("td[name=keywords]").text(item.keywords);
	alertMsg.correct("更新成功");
}

function createPageHtml(json,dom){
	alertMsg.correct("成功生成html页面！");
}

function setHomePage(json,dom){
	if(json){
		alertMsg.correct("设置成功");
	}
}
</script>
